Skip to content

Feature/301 create utility scripts to compute the next release build for cbs #310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

monvora
Copy link
Member

@monvora monvora commented Apr 11, 2025

  • Add shell script to compute the next release version: computeReleaseVersion.sh
  • Add Jenkins pipeline definition template that perform deployment through Wazi Deploy

dennis-behm and others added 30 commits January 30, 2025 10:47
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Co-authored-by: Mathieu Dalbin <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
Signed-off-by: Dennis Behm <[email protected]>
…utility-scripts-to-compute-the-next-release-build-for-CBS
Copy link
Member

@dennis-behm dennis-behm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@monvora can you please address:

  • permission bits - a lot got changed (I assume unintentionally)
  • update the README that this new script is available
  • minor comment.

The updates of the pipeline template should be planned in dedicated pull requests that are already captured in #311

export mainBranchSegment=`echo ${Branch} | awk -F "/" '{ print $1 }'`
export secondBranchSegment=`echo ${Branch} | awk -F "/" '{ print $2 }'`
export thirdBranchSegment=`echo ${Branch} | awk -F "/" '{ print $3 }'`
echo $PGM": [INFO] Branch segments: ${mainBranchSegment}, ${secondBranchSegment}, ${thirdBranchSegment}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove this print. It is a big confusing.
Maybe put it into a comment and add a comment that this is for debugging.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @dennis-behm for a review. I made all the changes we discussed. Now the PR contains:

  • computeReleaseVersion.sh script to compute the next release version.
  • Updated readme.md which documented about computeReleaseVersion.sh

Please have another reveiw.

Copy link
Member

@dennis-behm dennis-behm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@monvora - can you please add a section to the README about this new script, please?

…nor update to the computeReleaseVersion.sh script based on Dennis's feedback
@monvora
Copy link
Member Author

monvora commented Apr 29, 2025

@monvora - can you please add a section to the README about this new script, please?

Done...

Copy link
Member

@dennis-behm dennis-behm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@monvora Thanks for the documentation updates. I tested your script and this caused a set of new ideas. Can you please check my comments below?

echo $PGM": [INFO] Baseline reference: ${baselineRef}"

computeNextReleaseVersion
export releaseVersion="rel-"${newVersion}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check if newVersion was computed - basically if it is "set" like the other environment variables. If the variable is empty, set RC=8.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done...

@@ -133,7 +133,8 @@ Artifact Name | Description | Script details
---------- | -----| -----------------------------------------------------
[gitClone.sh](gitClone.sh) | Pipeline Shell Script to perform Git Clone to z/OS UNIX System Services | [script details](README.md#41---gitclonesh)
[dbbBuild.sh](dbbBuild.sh) | Pipeline Shell Script to invoke the Dependency Based Build framework [zAppBuild](https://github.com/IBM/dbb-zappbuild) | [script details](#dbbbuildsh-for-zappbuild-frameworkh)
[zBuilder.sh](zBuilder.sh) | Pipeline Shell script to invoke the zBuilder framework [zBuilder](https://www.ibm.com/docs/en/dbb/3.0?topic=building-zos-applications-zbuilder) | [script details](#zbuildersh-for-dbb-zbuilder)
[zBuilder.sh](zBuilder.sh) | Pipeline Shell Script to invoke the zBuilder framework [zBuilder](https://www.ibm.com/docs/en/dbb/3.0?topic=building-zos-applications-zbuilder) | [script details](#zbuildersh-for-dbb-zbuilder)
[computeReleaseVersion.sh](computeReleaseVersion.sh) | Pipeline Shell Script to compute the next release version based on the baseline version information stored in the [baselineReference.config](samples/baselineReference.config) file. | [script details](#computeReleaseVersionsh)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[computeReleaseVersion.sh](computeReleaseVersion.sh) | Pipeline Shell Script to compute the next release version based on the baseline version information stored in the [baselineReference.config](samples/baselineReference.config) file. | [script details](#computeReleaseVersionsh)
[computeReleaseVersion.sh](computeReleaseVersion.sh) | Pipeline Shell Script to compute the next release version based on the baseline version information stored in the application's [baselineReference.config](samples/baselineReference.config) file. | [script details](#computeReleaseVersionsh)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

getBaselineReference
if [ $rc -eq 0 ]; then
ERRMSG=$PGM": [INFO] Baseline reference: ${baselineRef}"
eecho $ERRMSG
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
eecho $ERRMSG
echo $ERRMSG

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done and tested

;;
*)
rc=8
ERRMSG=$PGM": [ERROR] Release type can only be Major, Minor or Patch. rc="$rc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ERRMSG=$PGM": [ERROR] Release type can only be Major, Minor or Patch. rc="$rc
ERRMSG=$PGM": [ERROR] No valid release type found. Valid release types are 'major', 'minor' or 'patch'. rc="$rc

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

@dennis-behm dennis-behm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@monvora I have a few more comments. Please see below. Thank you.

echo $ERRMSG
fi

tmp2=$(echo $ReleaseType | tr '[:upper:]' '[:lower:]')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this section could lead to a wrong behaviour. We should not set a default.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

ERRMSG=$PGM": [INFO] Compute the next release version complete. The next release version: ${releaseVersion}. rc="$rc
echo $ERRMSG
else
ERRMSG=$PGM": [ERROR] Compute the next release version failed. Check Console for details. rc="$rc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ERRMSG=$PGM": [ERROR] Compute the next release version failed. Check Console for details. rc="$rc
ERRMSG=$PGM": [ERROR] Compute the next release version failed. Check console for details. rc="$rc

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@dennis-behm dennis-behm linked an issue May 2, 2025 that may be closed by this pull request
Copy link
Member

@M-DLB M-DLB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments


# internal veriables
PGM=$(basename "$0")
PGMVERS="1.10"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PGMVERS="1.10"
PGMVERS="1.00"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

echo " -r <releaseType> - Type of the release "
echo " to calculate the version. "
echo " Accepted values: "
echo " - Major "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any checking of the case for this parm? The README says "major, minor, patch" but here it says it's "Major, Minor, Patch".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I've seen the translation below to all lowercase, but for consistency, it would be better to have the same values everywhere.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated value in the computeReleaseVersion.sh file to "major", "minor" and "patch".

Copy link
Member

@dennis-behm dennis-behm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this important script, @monvora .

@dennis-behm dennis-behm merged commit c48cecf into IBM:main May 20, 2025
1 check failed
@monvora monvora deleted the feature/301-create-utility-scripts-to-compute-the-next-release-build-for-CBS branch May 30, 2025 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create utility scripts to compute the next release build for CBS
3 participants